var http = require('http');

http.createServer((request, response) => {
    response.setHeader('Access-Control-Allow-Origin', '*');
    response.setHeader('Access-Control-Allow-Methods', '*');

    if(request.url === '/login') {
        var msg = {
            token: 'sjoaijsdoaos-1219829-asjdlakspdsad',
            success: true,
            code: 1
        }
        msg = JSON.stringify(msg)
        response.write(msg)
        response.end();
    } else if(request.url === '/register') {

        response.end('注册成功')
    }
}).listen(3000, '172.17.51.177', () => {
    console.log('server is running')
})